import Vue from "vue"
import Router from "vue-router"
import Home from "../components/Home"
import Login from "../components/Login";
import Register from "../components/Register";
import Course from "../components/Course";
import Detail from "../components/Detail";
import Cart from "../components/Cart";
import Order from "../components/Order";
import Success from "../components/Success";
import UserOrder from "../components/UserOrder";
import Player from "../components/Player";
//这里导入可以让用户访问的组件
Vue.use(Router);

export default new Router({
  // 设置路由模式为history, 去掉默认的#

  mode: "history",
  routes: [

    {
       name:"Home",
       path:"/",
       component:Home,
     },
    {
      name: "Home",
      path: "/home",
      component: Home,
    },
    {
      name: "Login",
      path: "/user/login",
      component: Login,
    },
    {
      name: "Register",
      path: "/user/register",
      component: Register,
    },
    {
      name: "Course",
      path: "/course",
      component: Course,
    },
    {
      name: "Detail",
      path: "/course/detail/:id",
      component: Detail,
    },
    {
      name: "Cart",
      path: "/cart",
      component: Cart,
    },
    {
      name: "Order",
      path: "/order",
      component: Order,
    },
    {
      name: "Success",
      path: "/payments/result",
      component: Success,
    },
     {
      path:"/user/order",
      name:"UserOrder",
      component: UserOrder
    },
    {
      path:"/course/player",
      name:"Player",
      component: Player,
    }
  ]
})
